import Vue from 'vue'
import request from '@/itsoftUI/utils/request'
import qs from "qs"
const baseUrl = Vue.prototype.$serviceUrl + "/repairInspection"

//巡检记录
export const statisticsApi = {
  // 区域巡检
  getRegionStatistics: function (params) {

    return request({
      url: baseUrl + '/statistics/regionStatistics',
      method: 'post',
      data: qs.stringify(params)
    })
  },
  // /inspectionLog/list 区域
  areaDetail: function (page, search, fields) {
    const data = {
      page, search, fields

    }
    return request({
      url: baseUrl + '/inspectionLog/list',
      method: 'post',
      data: qs.stringify(data)
    })
  },
  // 人员巡检
  getUserStatistics: function (params) {
    return request({
      url: baseUrl + '/statistics/userStatistics',
      method: 'post',
      data: qs.stringify(params)
    })
  },
  // 设备维修统计
  getRepairStatistics: function (params) {
    return request({
      url: baseUrl + '/statistics/repairStatistics',
      method: 'post',
      data: qs.stringify(params)
    })
  },
  // 设备动态表头
  // /statistics/repairTitle
  getRepairTitle: function (params) {
    return request({
      url: baseUrl + '/statistics/repairTitle',
      method: 'post',
      data: qs.stringify(params)
    })
  },
  // /deviceRepairLog/list
  getDeviceRepairLog: function (page, search, fields) {
    const data = {
      page, search, fields

    }
    return request({
      url: baseUrl + '/deviceRepairLog/list',
      method: 'post',
      data: qs.stringify(data)
    })
  },
  getSchoolList: function () {
    const data = {


    }
    return request({
      url: baseUrl + '/schoolAreaInfo/list',
      method: 'post',
      data: qs.stringify(data)
    })
  },
  List: function (params) {
    return request({
      url: baseUrl + '/inspectionLog/inspectionLog',
      method: 'post',
      data: qs.stringify(params)
    })
  },
  //提取信息
  Get: function (id) {
    const data = {
      id
    };
    return request({
      url: baseUrl + "/systemDictData/get",
      method: "post",
      data: qs.stringify(data)
    });
  },

  // 删除
  Del: function (ids) {
    const data = {
      ids
    }
    return request({
      url: baseUrl + "/systemDictData/delete",
      method: "post",
      data: qs.stringify(data)
    });
  },
  save: function (data) {
    const config = {
      headers: {
        'Content-Type': 'application/json;charset=utf-8'
      },
    }
    return request.post(baseUrl + "/systemDictData/save", data, config)
  }
}